/**
 * Created by no1 on 2015/12/21.
 */
'use strict';
let mongoose = require('mongoose');
var ObjectId = mongoose.Schema.ObjectId;
var Schema = mongoose.Schema;
var receiveLog = new Schema({
  id: {
    type: Number,
    index: true
  },

  //用户id
  uid: Number,
  //用户昵称
  nickname: String,
  //用户电话号码
  mobile: Number,
  //用户所在城市
  city: String,

  //优惠券id
  couponid: Number,
  //优惠券号 格式:YN加8位随机数
  couponCode: String,
  //优惠券名
  couponName: String,
  //面值1
  money: Number,
  //状态 1已领取 2 已使用
  status: Number,

  //最后更新时间
  updateAt: {
    type: Date,
    index: true,
    "default": Date.now
  },
  //创建时间
  createdAt: {
    type: Date,
    index: true,
    "default": Date.now
  }
});

module.exports = mongoose.model('receivelog', receiveLog);